package com.ws.gold.config;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author ws
 * @create 2025/6/6
 */
@Data
public class BaseEntity implements Serializable {

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @TableField(
            value = "create_time",
            fill = FieldFill.INSERT
    )
    @DateTimeFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    private LocalDateTime createTime;
    @TableField(
            value = "creator_id",
            fill = FieldFill.INSERT
    )
    private String creatorId;
    @TableField(
            value = "update_time",
            fill = FieldFill.INSERT_UPDATE
    )
    @DateTimeFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    private LocalDateTime updateTime;
    @TableField(
            value = "updater_id",
            fill = FieldFill.INSERT_UPDATE
    )
    private String updaterId;

    @TableLogic
    private Integer isDelete;

}
